#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <functional>
#include <boost/bind.hpp>
#include <boost/timer.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;

struct A
{
	A(int ii=0,char c='a'):i(ii),b(c){}
	int i;
	char b;
};

int main(int argc, char **argv)
{
        A a(123,'q');
        A b (88,'x');
	memset( &a, 0, sizeof(A) );
	bzero (&a,sizeof(A) );
	memcpy( &a, &b, sizeof(A) );
	bcopy( &a, &b, sizeof(A) );
	cout<<a.i<<endl<<a.b<<endl;

	// non POD copy is BAD!!!
	boost::shared_ptr<A> c0;

	if(true)
	{
		boost::shared_ptr<A> c(new A(123,'w') );
		cout<<c.use_count()<<endl;
		bcopy(&c, &c0, sizeof(c) );
		c.~shared_ptr();
		cout<<c0.use_count()<<endl;
	}

	cout<<c0->i<<endl<<c0->b<<endl;

	return 0;
}
